<!DOCTYPE html>
<html spellcheck="false">
<head>
  <meta charset="utf-8">
  <title>Does handleEvent throw</title>
</head>
<body>
<div id="result"></div>
<script>
  var testNode = null, eventName = "test1";
  function listen(listener, capture) {
    document.addEventListener(eventName, listener, capture);
  }
  window.onload = function() {
    var arr = [
      {}, { foo: 1 }, { handleEvent: undefined }, { handleEvent: null }, { handleEvent: 1 },
      { handleEvent: false }, { handleEvent: {} },
      { handleEvent: window.Symbol && Symbol.iterator },
      { handleEvent: NaN }, { handleEvent: -1 },
      { handleEvent: "adfas", bar: 12 }, { handleEvent: function () {} },
    ];
    for (const i of arr) { listen(i, false); listen(i, true) }
    console.log("test start")
    document.body.dispatchEvent(new Event(eventName));
    setTimeout(function() { console.log("test end") });
    result.innerText = "Open console to see results of " + arr.length + " tests.\n";
    result.append("On 2019-11-17, Chrome 78 has no exceptions, but Firefox 70 reports 11 errors");
  }
</script>
</body>
</html>
